package com.cn.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.cn.domain.Order;

public class OrderDao extends HibernateDaoSupport {

	public void saveorder(Order order) {
	
		this.getHibernateTemplate().save(order);
		
	}

	public List<Order> findAllOrder() {
		String hql="from Order";
	List<Order> listorder =	this.getHibernateTemplate().find(hql);
	if(listorder.size()>0)
		return listorder;
	return null;
	}

	public Order getCustomerOid(Integer oid) {
	
		return 	(Order)this.getHibernateTemplate().get(Order.class,oid);
	}

	public void updateCustomerState(Order order) {
	
		this.getHibernateTemplate().update(order);
		
	}

}
